home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Inventor Labs: Technology
/
INVENTORLABS_TECHNOLOGY.BIN
/
pc
/
files
/
shared.cst
/
00502_Script_pano callbacks
< prev
next >
Wrap
Text File
|
1997-07-24
|
7KB
|
200 lines
-- InitPanoCallbacks
--
-- Initializes the callbacks used for panoramic movies.
-------------------------------------------------------------------------------
on InitPanoCallbacks
global gQTVRInstance
if IsQTVRMovie(gQTVRInstance) then
QTVRSetRolloverHotSpotHandler(gQTVRInstance,"sampleRolloverHotSpotHandler")
--QTVRSetMouseOverHandler(gQTVRInstance,"sampleMouseOverHandler")
--QTVRSetMouseDownHandler(gQTVRInstance,"sampleMouseDownHandler")
--QTVRSetPanZoomStartHandler(gQTVRInstance,"samplePanZoomStartHandler")
--QTVRSetMouseStillDownHandler(gQTVRInstance,"sampleMouseStillDownHandler")
--QTVRSetNodeLeaveHandler(gQTVRInstance,"sampleNodeLeaveHandler")
--QTVRSetRolloverHotSpotHandler(gQTVRInstance,empty)
QTVRSetMouseOverHandler(gQTVRInstance,empty)
QTVRSetMouseDownHandler(gQTVRInstance,empty)
QTVRSetPanZoomStartHandler(gQTVRInstance,empty)
QTVRSetMouseStillDownHandler(gQTVRInstance,empty)
QTVRSetNodeLeaveHandler(gQTVRInstance,empty)
end if
end
--=============================================================================
-- XCMD Callback Factory
-------------------------------------------------------------------------------
--=============================================================================
-- CallBackTracer
--
-- As described in "Using Lingo", Appendix A. Pass any mSendCardMessage
-- commands on to Lingo so that callbacks can be handled.
-------------------------------------------------------------------------------
factory CallBackTracer
method mNew
method mEvalExpr pExpr
method mSendHCMessage pMessage
method mSendCardMessage pMessage
do pMessage
method mGetFieldByName pCard, pName
method mGetFieldByNum pCard, pNum
method mGetFieldByID pCard, pID
method mSetFieldByName pCard, pName, pValue
method mSetFieldByNum pCard, pNum, pValue
method mSetFieldByID pCard, pID, pValue
end
--=============================================================================
-- Routines used by Pano Callbacks screens
-------------------------------------------------------------------------------
on TestMouseOverHandler
global gQTVRInstance
if IsQTVRMovie(gQTVRInstance) then
put "In mouse over at: " & the ticks into member "MouseOverHandler Message"
end if
end
on TestRolloverHotSpotHandler pHotSpotID
global gQTVRInstance
if IsQTVRMovie(gQTVRInstance) then
if pHotSpotID = 0 then
put "ID: " & pHotSpotID & RETURN & "Name:" into member "RolloverHotSpotHandler Message"
else
QTVRSetHotSpotID(gQTVRInstance, integer(pHotSpotID))
set spotName = QTVRGetHotSpotName(gQTVRInstance)
put "ID: " & pHotSpotID & RETURN & "Name: " & spotName into member "RolloverHotSpotHandler Message"
end if
end if
end
on TestMouseDownHandler
global gQTVRInstance
if IsQTVRMovie(gQTVRInstance) then
put "In mouse down at: " & the ticks into member "MouseDownHandler Message"
QTVRPassMouseDown(gQTVRInstance)
end if
end
on TestPanZoomStartHandler
global gQTVRInstance
if IsQTVRMovie(gQTVRInstance) then
put "In pan zoom start at: " & the ticks into member "PanZoomStartHandler Message"
end if
end
on TestMouseStillDownHandler
global gQTVRInstance
if IsQTVRMovie(gQTVRInstance) then
put "In mouse still down at: " & the ticks into member "MouseStillDownHandler Message"
put RETURN & QTVRGetPanAngle(gQTVRInstance) after member "MouseStillDownHandler Message"
end if
end
on TestNodeLeaveHandler pToNode
global gQTVRInstance
if IsQTVRMovie(gQTVRInstance) then
put "Leaving node ID: " & pToNode into member "NodeLeaveHandler Message"
end if
end
--=============================================================================
-- Sample PanoMovie callback handler routines
-------------------------------------------------------------------------------
--=============================================================================
-- SampleMouseOverHandler
--
-- Called by PanoMovie periodically during mouseOver.
-------------------------------------------------------------------------------
on SampleMouseOverHandler
put "Mouse over panoramic movie"
-- If you want to exit from mouseOver, use this line
global gQTVRInstance
if IsQTVRMovie(gQTVRInstance) then
-- QTVRExitMouseOver(gQTVRInstance)
end if
end
--=============================================================================
-- SampleRolloverHandler
-- pHotSpotID is the id of the hot spot the user is over
--
-- Called by PanoMovie whenever the hot spot the cursor is over changes.
-------------------------------------------------------------------------------
on SampleRolloverHotSpotHandler pHotSpotID
global gQTVRInstance
-- put QTVRGetHotSpotID(gQTVRInstance) into member "Current Hot Spot ID"
put pHotSpotID into cast "Current Hot Spot ID"
end
--=============================================================================
-- SampleMouseDownHandler
--
-- Called by PanoMovie when a mouseDown event occurs during a mouseOver call
-------------------------------------------------------------------------------
on SampleMouseDownHandler
put "Mouse down during mouseOver call"
global gPanoMovieID
if IsQTVRMovie(gQTVRInstance) then
QTVRPassMouseDown(gQTVRInstance)
end if
end
--=============================================================================
-- SamplePanZoomStartHandler
--
-- Called once by PanoMovie when the user starts to pan or zoom.
-------------------------------------------------------------------------------
on SamplePanZoomStartHandler
put "About to pan or zoom in panoramic movie"
end
--=============================================================================
-- SampleMouseStillDownHandler
--
-- Called by PanoMovie periodically during while the mouse is down within
-- mouseOver or mouseDown.
-------------------------------------------------------------------------------
on SampleMouseStillDownHandler
put "Enter mouse still down from panoramic movie"
global gQTVRInstance
if IsQTVRMovie(gQTVRInstance) then
-- put QTVRGetPanAngle(gQTVRInstance) into tPanAngle
-- put "PanAngle is currently: " & tPanAngle
end if
put "Leave mouse still down from panoramic movie"
end
--=============================================================================
-- SampleNodeLeaveHandler
-- pToNodeID is the id of the node the user is leaving
--
-- Called by PanoMovie when the user moves between nodes by clicking on link
-- hot spots.
-------------------------------------------------------------------------------
on SampleNodeLeaveHandler pToNode
put "Jumping to node " & pToNode & " in panoramic movie"
end